<template>
	<view class="content">
		账号：<input type="text" v-model="dataForm.username">
		密码：<input type="text" v-model="dataForm.password">
		<uni-captcha scene="register" v-model="dataForm.captcha"></uni-captcha>
		<uni-popup-captcha ref="popupCaptcha" @confirm="verifyCaptcha" scene="test" v-model="dataForm.captcha"></uni-popup-captcha>
		<button @click="openPopupCaptcha" >显示弹出式验证码</button>
		<button @click="createUser">创建</button>
	</view>
</template>

<script setup>
	import { onLoad } from '@dcloudio/uni-app';
	import { reactive,ref } from 'vue';
	const uniIdCo = uniCloud.importObject('uni-id-co');
	const dataForm = reactive({
		username:'',
		password:'',
		captcha:''
	})
	const popupCaptcha = ref()
	const verifyCaptcha = ()=>{}
	const openPopupCaptcha = ()=>{
		popupCaptcha.value?.open()
	}
	const createUser = async ()=>{
		const res = await uniIdCo.registerAdmin(dataForm);
		console.log(res,'res1212')
	}
	
</script>

<style>
	
</style>
